<?php


namespace App\Models;


use Base\BaseModel;
use Lib\DB;

class AreaModel extends BaseModel
{
    protected $table = 'area';

    public function getVantAreaList()
    {
        return DB::init()->select(
            $this->table,
            ['id', 'name', 'level']
        );
    }

    public function getAreaById($id = false, $fields = '*')
    {
        if (!$id) return [];
        return DB::init()->get(
            $this->table,
            $fields, [
                'id' => $id
            ]
        );
    }
}
